﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SwinGame;
using System.Drawing;

namespace SimpleSurvival.src
{
    //-----------------------------------------------//
    //CLASS - Keyboard.cs
    //-----------------------------------------------//
    //Provides global access to the keyboard input
    public static class KeyboardInput
    {
        //Gets an offset vector from keyboard inputs
        public static Point GetKeyboardOffset(KeyCode leftK, KeyCode rightK, KeyCode upK, KeyCode downK)
        {
            int dx = 0; int dy = 0;
            if (Input.KeyDown(leftK)) { dx--; }
            if (Input.KeyDown(rightK)) { dx++; }
            if (Input.KeyDown(upK)) { dy--; }
            if (Input.KeyDown(downK)) { dy++; }
            return new Point(dx, dy);
        }
    }
}
